Skip to content

fix(config): use ~/.devsy on macOS to avoid spaces in paths#416

Merged
skevetter merged 2 commits into
mainfrom
fix/macos-path-spaces
May 22, 2026
Merged

fix(config): use ~/.devsy on macOS to avoid spaces in paths#416
skevetter merged 2 commits into
mainfrom
fix/macos-path-spaces

Conversation

@skevetter

@skevetter skevetter commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Change macOS data/config paths from ~/Library/Application Support/devsy to ~/.devsy
  • Fixes provider init scripts that use $PROVIDER_FOLDER without quotes in shell commands, which caused word-splitting on the space in "Application Support"
  • Error was: stat /Users/.../Library/Application: no such file or directory followed by init: exit status 127
  • Cache moves to ~/.cache/devsy (also space-free)
  • Consistent with how many CLI tools behave on macOS

Summary by CodeRabbit

  • Refactor
    • On macOS, configuration, cache, and state files are now stored in hidden directories within the user's home folder (e.g., ~/.<RepoName>) instead of the ~/Library directories.

Review Change Stack

Provider init scripts run via shell and reference $PROVIDER_FOLDER.
On macOS, ~/Library/Application Support/devsy contains a space which
causes word-splitting in unquoted shell expansions, breaking provider
initialization with "stat .../Application: no such file or directory".

Use ~/.devsy consistently on macOS (matching the Linux ~/.local/share
pattern in spirit) to eliminate spaces in all paths.
@netlify

netlify Bot commented May 22, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 7caf012
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a10d03502954700084379f8

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 26 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 892f5c26-ebce-4036-b403-757447d6a9a0

📥 Commits

Reviewing files that changed from the base of the PR and between db89be4 and 7caf012.

📒 Files selected for processing (2)
  • pkg/config/pathmanager_linux.go
  • pkg/config/pathmanager_linux_test.go
📝 Walkthrough

Walkthrough

The macOS path manager is updated to use Unix-style hidden home directories for configuration, data, cache, and state instead of macOS standard locations. ConfigDir and DataDir now use ~/.<RepoName>, CacheDir uses ~/.cache/<RepoName>, and StateDir uses ~/.<RepoName>/state.

Changes

macOS Path Manager Migration

Layer / File(s) Summary
macOS directory path migration
pkg/config/pathmanager_darwin.go
ConfigDir(), DataDir(), CacheDir(), and StateDir() methods are updated to use Unix-style hidden directories (~/.RepoName, /.cache/RepoName) in place of macOS standard locations (/Library/Application Support, ~/Library/Caches).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: moving macOS config paths from ~/Library/Application Support/devsy to ~/.devsy to avoid spaces in paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Align Linux path layout with macOS: drop XDG directory lookups in favor
of ~/.devsy, ~/.cache/devsy, and /tmp/devsy-UID. This keeps provider
scripts safe from word-splitting issues and simplifies cross-platform
path handling.
@github-actions github-actions Bot added size/m and removed size/xs labels May 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/config/pathmanager_darwin.go (1)

22-56: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Add macOS migration/fallback for legacy ~/Library/*/devsy data when switching to ~/.devsy / ~/.cache/devsy.

pkg/config/pathmanager_darwin.go now always computes config/data under ~/.devsy and cache under ~/.cache/devsy, with no fallback/migration logic for prior macOS “Library” locations. A repo-wide search only finds Library/Application Support usage in pkg/ide/vscode/settings.go (unrelated), and there’s no code that copies/moves or re-reads legacy top-level directories. DEVSY_HOME only changes the root directory; it doesn’t migrate existing data.

Implement one of: (1) first-run move/copy from legacy dirs to the new dirs, or (2) fallback reads of legacy dirs when the new dirs are empty, plus user-facing messaging/docs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/config/pathmanager_darwin.go` around lines 22 - 56, The darwinPathManager
methods (ConfigDir, DataDir, CacheDir, StateDir) only return ~/.devsy and
~/.cache/devsy and must handle legacy macOS locations; implement a
migration/fallback that checks legacy paths (e.g. ~/Library/Application
Support/devsy for config/data, ~/Library/Caches/devsy for cache, and
~/Library/Application Support/devsy/state for state) and either (A) on first-run
move or copy existing files from those legacy dirs into the new dirs and return
the new path, or (B) if you prefer non-destructive behavior, return the legacy
path when the new target is empty (and log/emit a user-facing message that
legacy data was found and will be migrated or used). Add this logic in a single
helper invoked by darwinPathManager.ConfigDir/DataDir/CacheDir/StateDir (reuse
ensureDir and RepoName) and ensure the migration runs only once (persist a
migrated flag or create a marker file) to avoid repeated work.
🧹 Nitpick comments (1)
pkg/config/pathmanager_darwin.go (1)

31-38: 💤 Low value

ConfigDir and DataDir now return identical paths.

Both ConfigDir() and DataDir() now return ~/.devsy, meaning configuration files (e.g., config.yaml) and data subdirectories (e.g., contexts/, workspaces/) will coexist in the same directory. While this aligns with common CLI tool patterns on macOS (e.g., kubectl, docker) and achieves the goal of avoiding spaces, it deviates from the XDG Base Directory spec principle of separating config and data concerns.

Consider whether this could cause namespace conflicts in the future if data subdirectories or config filenames overlap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/config/pathmanager_darwin.go` around lines 31 - 38, ConfigDir() and
DataDir() in darwinPathManager currently return the same path (~/.<RepoName>),
risking future namespace conflicts; change darwinPathManager.DataDir to return a
distinct data directory (for example using macOS convention
"~/Library/Application Support/<RepoName>" or XDG_DATA_HOME fallback) instead of
joining UserHome with "."+RepoName, and ensure you still call ensureDir on that
new path; update references to RepoName and the ensureDir(filepath.Join(...))
call in the DataDir method to construct and create the separate data path while
leaving ConfigDir unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/config/pathmanager_darwin.go`:
- Around line 22-56: The darwinPathManager methods (ConfigDir, DataDir,
CacheDir, StateDir) only return ~/.devsy and ~/.cache/devsy and must handle
legacy macOS locations; implement a migration/fallback that checks legacy paths
(e.g. ~/Library/Application Support/devsy for config/data,
~/Library/Caches/devsy for cache, and ~/Library/Application Support/devsy/state
for state) and either (A) on first-run move or copy existing files from those
legacy dirs into the new dirs and return the new path, or (B) if you prefer
non-destructive behavior, return the legacy path when the new target is empty
(and log/emit a user-facing message that legacy data was found and will be
migrated or used). Add this logic in a single helper invoked by
darwinPathManager.ConfigDir/DataDir/CacheDir/StateDir (reuse ensureDir and
RepoName) and ensure the migration runs only once (persist a migrated flag or
create a marker file) to avoid repeated work.

---

Nitpick comments:
In `@pkg/config/pathmanager_darwin.go`:
- Around line 31-38: ConfigDir() and DataDir() in darwinPathManager currently
return the same path (~/.<RepoName>), risking future namespace conflicts; change
darwinPathManager.DataDir to return a distinct data directory (for example using
macOS convention "~/Library/Application Support/<RepoName>" or XDG_DATA_HOME
fallback) instead of joining UserHome with "."+RepoName, and ensure you still
call ensureDir on that new path; update references to RepoName and the
ensureDir(filepath.Join(...)) call in the DataDir method to construct and create
the separate data path while leaving ConfigDir unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aaac61b8-a9d3-4e1e-873d-7e25bc4ceb9a

📥 Commits

Reviewing files that changed from the base of the PR and between 7f849b9 and db89be4.

📒 Files selected for processing (1)
  • pkg/config/pathmanager_darwin.go

@skevetter
skevetter merged commit 2e94481 into main May 22, 2026
52 checks passed
@skevetter
skevetter deleted the fix/macos-path-spaces branch May 22, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant